<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <%@include file="../common/common.jsp" %>
    <title>学院管理</title>
	<meta charset="UTF-8">
  </head>
  
  <body>
    <form class="form-inline definewidth m20" action="college/query.do" method="post">    
		<button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; 
    	<button type="button" class="btn btn-success" id="btnAdd">新增</button>
	</form>
	<table class="table table-bordered table-hover definewidth m10">
	    <thead>
	    <tr>
	        <th>No.</th>
	        <th>学院名称</th>
	        <th>操作</th>
	    </tr>
	    </thead>
	    <tbody>
	    	<c:forEach var="info" varStatus="i" items="${list }">
				<tr>
		            <td>${i.count }</td>
		            <td>${info.name }</td>
		            <td>
		                <a href="javascript:void(0)" onclick="edit('${info.id}')">编辑</a>&nbsp;&nbsp;
<!-- 		                <a href="javascript:void(0)" onclick="setting('${info.id}')">设置专业</a>                -->
		            </td>
		        </tr>
	        </c:forEach>
	   </tbody>
	</table>
  </body>
  <script type="text/javascript" src="<%=basePath%>js/lhgdialog/lhgdialog.min.js"></script>
  <script type="text/javascript">
  	function edit(id){
  	   window.location.href="<%=basePath%>college/toEdit.do?id="+id+"&action=update";
  	}
  	function setting(id){
  		$.dialog({
  			content: 'url:<%=basePath%>baseinfo/setProfessional.jsp',
  			title:'设置专业',width:500,height:300,lock: true,
  		});
  	}
  	$(function (){
  		$("#btnAdd").click(function (){
  			window.location.href="<%=basePath%>baseinfo/collegeEdit.jsp?action=add";
  		});
  	});
  </script>
</html>
